Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demonstrate how to cp source tarballs to add in rspm #283

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dpastoor
Copy link

@dpastoor dpastoor commented Apr 1, 2022

The result of following the instructions in the package-manager/README.me will result in a new demopkgs repo created:

Pasted image 20220328084739

@dpastoor dpastoor requested a review from colearendt April 1, 2022 15:03
@CLAassistant
Copy link

CLAassistant commented Apr 1, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@colearendt colearendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! Thanks for writing this up! I'll have to take a more careful read through the docs.

One question: what are your thoughts around docker cp and whether that would more neatly solve the problem without having to add another volume and the overhead, confusion, and permissions issues that volumes can create when written from the host and read from the container? (IIRC volumes can be a notorious troublesome spot in linux, as well as in certain versions / configurations of docker desktop for mac)

@dpastoor
Copy link
Author

dpastoor commented Apr 6, 2022

what are your thoughts around docker cp

my thoughts are - oh nice! I've never used that 😎

Lemme give that a whirl. The case that I can think of that I want to make sure doesn't get wonky is we'd need the guidance to prob match up to copy into /data so the tarball will still ultimately land in the persistent dir, else if you docker-compose down then the db/everything else expecting the tarball would still live on and then might go sideways on start up next time.

I concur that keeping things as simple as possible especially around what crosses the host boundaries is ideal.

@colearendt
Copy link
Contributor

Nice! It's worth noting that RSPM also "caches" the tarball, so once you have imported it, you can actually dispense with it 😄 We don't make that very clear in our docs, as far as I can tell, but if you are persisting the database and the data directory then there is really no need to keep track of the tarball - ephemeral storage is just fine 😄

@dpastoor
Copy link
Author

dpastoor commented Apr 6, 2022

that is definitely an interesting tidbit to know!

@dpastoor
Copy link
Author

dpastoor commented May 6, 2022

round 2 - trying flow with docker cp:

built demo1 pkg in the rsw container:

image

we see demo1_0.1.0.tar.gz kicked out in data/rsw/rstudio

data/rsw/rstudio🔒 on  rspm_mnt [!]
❯ ls
R  demo1  demo1_0.1.0.tar.gz

find container id:

❯ docker ps
CONTAINER ID   IMAGE      
1b6f4f5fc669   rstudio/rstudio-package-manager:2021.12.0-3  ...

copy from host into rspm image:

docker cp data/rsw/rstudio/demo1_0.1.0.tar.gz 1b6f4f5fc669:/tmp

cool deal its there:

❯ docker exec -it 1b6f4 /bin/bash
root@1b6f4f5fc669:/# ls /tmp
demo1_0.1.0.tar.gz
root@1b6f4f5fc669:/# rspm create source --name=demopkgs
Source 'demopkgs':
  Type:  Local
root@1b6f4f5fc669:/# rspm add --source=demopkgs --path='/tmp/demo1_0.1.0.tar.gz'
Added package '/tmp/demo1_0.1.0.tar.gz'.
root@1b6f4f5fc669:/# rspm create repo --name=demopkgs --description="demo package repo"
Repository: demopkgs - demo package repo - R
root@1b6f4f5fc669:/# rspm subscribe --repo=demopkgs --source=demopkgs
Repository: demopkgs
Sources:
--demopkgs (Local)

and looks like we're in business:

image

@dpastoor dpastoor changed the title add rspm_mnt so can easily mount source tarballs to add in rspm demonstrate how to cp source tarballs to add in rspm May 6, 2022
@dpastoor dpastoor requested a review from colearendt May 6, 2022 14:26
@dpastoor
Copy link
Author

dpastoor commented May 6, 2022

@colearendt docker cp worked like a charm - renamed the PR and updated the docs to show the new flow. Demonstration of e2e steps + screenshots also in PR above

@colearendt colearendt added the documentation Improvements or additions to documentation label Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants